<template>
  <div>
    <table  class="list">
      <tr  v-for="(item,index) in voteStatic">
        <td>
          {{index+1}}
        </td>
        <td>
          <el-avatar shape="circle" size="small" :src="item.img"></el-avatar>
        </td>
        <td>
          {{item.name}}
        </td>
        <td>
          {{item.description}}
        </td>
        <td>
          {{item.ticket}}票
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
  import voteMixin from '@/mixins/vote'

  export default {
    data () {
      return {
        voteStatic:[]
      }
    },
    components: {

    },
    mixins: [voteMixin],
    activated () {
      this.getVoteStatic()
    },
    methods: {
      // 获取数据列表
      getVoteStatic () {
        this.$http({
          url: this.$http.adornUrl('/vote/votehistory/listStatic'),
          method: 'get',
          params: this.$http.adornParams({'voteId': this.voteId})
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.voteStatic = data.list
          }
        })
      }
    }
  }
</script>
<style lang="scss" scoped>

  .list{
    width:100%;
    padding: 10px;
    table-layout: fixed;
  }


</style>
